<?php
	/**
	* Video Category Delete
	* @author: trungdt
	* @since: Oct 26, 2011
	* @version: 1.0
	* 
	* Change logs
	*/

	if (!defined('EXPONENT')) exit('');
	if ( exponent_users_isAdmin() || exponent_permissions_check(array("administrate", "delete"), $loc))
	{
		$cat = null;
		if (isset($_REQUEST['id'])) {
			
			// remove all video in cats
			$action = $db->delete('videomodule_video', 'cat_id='.intval($_REQUEST['id']));
			
			$action = $db->delete('videomodule_cat', 'id='.intval($_REQUEST['id']));
			
		}
		exponent_flow_redirect();
	}
    else
    {
        echo exponent_http_error(403);
    }
?>